<template>
	<HyCard title="单位信息">
		<el-descriptions :column="3" border>
			<el-descriptions-item label="责任部门" width="120px">
				<el-tag :disable-transitions="true" :key="index * 2" :index="index" v-for="(item, index) in basicInfoData.responsibleDept.split(',')"
					>{{ item }}
				</el-tag>
			</el-descriptions-item>
			<el-descriptions-item label="预算单位" width="120px">
				<el-tag :key="index * 2" :index="index" v-for="(item, index) in basicInfoData.budgetUnit.split(',')"
					>{{ item }}
				</el-tag></el-descriptions-item
			>
			<el-descriptions-item label="应用牵头部门" width="120px">
				<el-tag :key="index * 2" :index="index" v-for="(item, index) in basicInfoData.leadDept.split(',')">{{ item }} </el-tag></el-descriptions-item
			>
		</el-descriptions>
	</HyCard>
	<div class="mt-5"></div>
	<div class="mt-5"></div>
	<HyCard title="设计单位信息">
		<el-descriptions :column="2" border>
			<el-descriptions-item label="统一社会信用代码" width="120px">{{ designUnitInfoData.socialCode}}</el-descriptions-item>
			<el-descriptions-item label="单位名称" width="120px">{{ designUnitInfoData.designUnit }}</el-descriptions-item>
		</el-descriptions>
	</HyCard>
	<div class="mt-5"></div>
	<div class="mt-5"></div>
	<HyCard title="应用信息">
		<el-descriptions :column="3" border>
			<el-descriptions-item label="应用名称" width="120px">{{ applyInfoData.appName }}</el-descriptions-item>
			<el-descriptions-item label="应用负责人" width="120px">{{ applyInfoData.principalName }}</el-descriptions-item>
			<el-descriptions-item label="负责人手机号码" width="120px">{{ applyInfoData.principalPhone }}</el-descriptions-item>
			<el-descriptions-item label="应用建设类型" width="120px">
				<dict-tag :options="appConstructionTypeArr" :value="applyInfoData.appConstructionType"></dict-tag>
			</el-descriptions-item>
			<el-descriptions-item label="应用建设描述" width="120px">
				<dict-tag :options="projectTypeArr" :value="applyInfoData.projectType"></dict-tag>
			</el-descriptions-item>
			<el-descriptions-item label="应用预算年度(年)" width="120px">{{ applyInfoData.budgetYear }}</el-descriptions-item>
			<el-descriptions-item label="应用建设起始时间" width="120px">{{ applyInfoData.developBeginDate }}</el-descriptions-item>
			<el-descriptions-item label="应用建设结束时间" width="120px">{{ applyInfoData.developEndDate }}</el-descriptions-item>
			<el-descriptions-item label="应用领域" width="120px">
				<dict-tag :options="culture_type" :value="applyInfoData.domain"></dict-tag>
			</el-descriptions-item>
			<el-descriptions-item label="应用总投资(万元)" width="120px">{{ applyInfoData.totalBudget }}</el-descriptions-item>
			<el-descriptions-item label="应用年度预算(万元)" width="120px">{{ applyInfoData.yearBudget }}</el-descriptions-item>
			<el-descriptions-item label="资金来源" width="120px">
				<dict-tag :options="fund_resource" :value="applyInfoData.fundResource"></dict-tag>
			</el-descriptions-item>
			<el-descriptions-item label="其他资金来源名称" width="120px" v-if="applyInfoData.otherFund">{{ applyInfoData.otherFund }}</el-descriptions-item>
			<el-descriptions-item label="其他资金(万元)" width="120px" v-if="applyInfoData.otherAmount">{{ applyInfoData.otherAmount }}</el-descriptions-item>
			<el-descriptions-item label="中央财政资金(万元)" width="120px" v-if="applyInfoData.centerAmount"
				>{{ applyInfoData.centerAmount }}</el-descriptions-item
			>
			<el-descriptions-item label="市级财政资金(万元)" width="120px" v-if="applyInfoData.cityAmount"
				>{{ applyInfoData.cityAmount }}</el-descriptions-item
			>
			<el-descriptions-item label="区县财政资金(万元)" width="120px" v-if="applyInfoData.districtAmount"
				>{{ applyInfoData.districtAmount }}</el-descriptions-item
			>
			<el-descriptions-item label="部门自筹资金(万元)" width="120px" v-if="applyInfoData.deptAmount"
				>{{ applyInfoData.deptAmount }}</el-descriptions-item
			>
			<el-descriptions-item label="银行贷款等投资(万元)" width="120px" v-if="applyInfoData.bankAmount"
				>{{ applyInfoData.bankAmount }}</el-descriptions-item
			>

			<el-descriptions-item label="建设层级" width="120px">
				<dict-tag :options="app_construction_level" :value="applyInfoData.hierarchy"></dict-tag>
			</el-descriptions-item>
			<el-descriptions-item label="建设模式" width="120px">
				<dict-tag :options="app_construction_mode" :value="applyInfoData.mode"></dict-tag>
			</el-descriptions-item>
			<el-descriptions-item label="是否国产化" width="120px">
				<dict-tag :options="yes_no_type" :value="applyInfoData.localization"></dict-tag>
			</el-descriptions-item>
		</el-descriptions>
	</HyCard>
</template>

<script setup lang="ts">
import HyCard from '/@/components/HyCard/index.vue';
import { defaultValue } from '../../utils/default';
import { useDict } from '/@/hooks/dict';
// 定义字典
const { culture_type, fund_resource, app_construction_level, app_construction_mode, yes_no_type } = useDict(
	'culture_type',
	'fund_resource',
	'app_construction_level',
	'app_construction_mode',
	'yes_no_type'
);
const projectTypeArr = ref([
	{ label: '新建', value: '1' },
	{ label: '续建', value: '2' },
	{ label: '首次运维', value: '3' },
	{ label: '连续运维', value: '4' },
]);
const appConstructionTypeArr = ref([
	{ label: '开发应用', value: '1' },
	{ label: '运维应用', value: '2' },
]);
const props = defineProps({
	basicInfoData: {
		type: Object,
		default: () => defaultValue().basicInfoDefault,
	},
	designUnitInfoData: {
		type: Object,
		default: () => defaultValue().designUnitInfo,
	},
	applyInfoData: {
		type: Object,
		default: () => defaultValue().applyInfoDefault,
	},
});
</script>

<style scoped></style>
